package routes

import (
	"github.com/flaravel/quanlaolao/app/http/controllers"
	"github.com/gorilla/mux"
)

func RegisterApiRoutes(router *mux.Router) {

	// 首页
	index := new(controllers.IndexController)
	group := new(controllers.GroupPromotionController)
	router.HandleFunc("/api/index", index.Index).Methods("GET").Name("api.index")

	// 群裂变
	router.HandleFunc("/api/group", group.Store).Methods("POST").Name("api.group")

	// 查看
	router.HandleFunc("/api/group/{id}", group.Show).Methods("GET").Name("api.show")

	// jssd
	router.HandleFunc("/api/jssdk", group.Jssdk).Methods("POST").Name("api.jssdk")
}
